import { colors } from '@/constants/injection-key';

export function back() {
  uni.navigateBack()
}
export const searchStyle = {
  'background-color': colors.bgColor,
  'border-radius': '100px',
  'padding': '0 16rpx',
  'height': '64rpx',
  'light-height': '64rpx',
  'min-width': '200rpx'
}

//
export function getPromotion(item: any) {
  if (item ? item.promotionMap : item.promotionMap) {
    const fieldList = item ? item.promotionMap : item.promotionMap
    let array: any = [];
    Object.keys(fieldList).forEach((child) => {
      if (!array.includes(child.split("-")[0])) {
        array.push(child.split("-")[0]);
      }
    });
    return array;
  }
}
